<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Youssef Gamil</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
      <table border="1">
          <tr>
              <td></td>
              <td onmouseover="chk(1);setc(0,-1);" onclick="chk(1);setc(0,-1);" >Up</td>
              <td></td>
          </tr>
          <tr>
              <td onmouseover="chk(2);setc(-1,0);" onclick="chk(2);setc(-1,0);" >Left</td>
              <td></td>
              <td onmouseover="chk(3);sp=10;setc(1,0);" onclick="chk(3);setc(1,0);" >Right</td>
          </tr>
          <tr>
              <td onclick="ss('lc');">Left Click</td>
              <td onmouseover="chk(4);setc(0,1);" onclick="chk(4);setc(0,1);" >Down</td>
              <td onclick="ss('rc');">Right Click</td>
          </tr>
      </table>
      <div id="vv"></div>
      <iframe id="fr" frameborder="0" scrolling="no"></iframe>
<script>
var ip=location.href.substring(0,location.href.lastIndexOf('/'));
var key=prompt("Connection Key:");
//document.write(ip+"<br>");
//document.write(location.href.substring(location.href.indexOf('/')+2,location.href.lastIndexOf('/')));
var cx,cy,sp=10;
cx=cy=0;
var ch=-1;
function chk(sh)
{
	if(ch!=sh)	sp=10;
	ch=sh;
document.all["vv"].innerHTML=sp;
}
function setc(x,y)
{
    cx+=x*sp;
    cy+=y*sp;
	if(cx<0)cx=0;
	if(cy<0)cy=0;
    sp*=2;
//    document.all["vv"].innerHTML=cx+","+cy;
    document.all["fr"].src=ip+"/"+key+"?x="+cx+",y="+cy;
}
function ss(x)
{
    document.all["fr"].src=ip+"/"+key+"?"+x;
}
</script>
  </body>
</html>
